package org.ihelpuoo.io;

import org.ihelpuoo.parser.token.InvalidCharException;
import org.ihelpuoo.parser.token.WordBoundaryChecker;

public class EscapeSlashChecker extends WordBoundaryChecker
{

	private boolean	prevIsSlash;

	public EscapeSlashChecker()
	{
		prevIsSlash = false;
	}

	@Override
	public int doCheck(int c) throws InvalidCharException
	{
		if (prevIsSlash)
		{
			prevIsSlash = false;
			return c;
		}
		if (c == '\\')
		{
			prevIsSlash = true;
			return IGNORE_IT;
		}
		return super.doCheck(c);

	}
}
